var xmlhttp;
var refreshuserlistintervalid = setInterval("refreshUserList()", 1000);
function refreshUserList()
{
	var roomname = document.getElementById("roomname").innerHTML;
	if(roomname == null){
		return;
	}
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null){
		alert ("This web browser does not support HTTP Requests. Please update your browser for a full user experience of the site.");
		return;
	}
	var url="/hmg/UserRoomServlet?sid="+Math.random()+"&name="+roomname;
	xmlhttp.onreadystatechange=stateChanged;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
}

function stateChanged()
{
	if (xmlhttp.readyState==4){
		document.getElementById("userlist").innerHTML=xmlhttp.responseText;
	}
}

function GetXmlHttpObject()
{
	if (window.XMLHttpRequest)
	{
		// code for IE7+, Firefox, Chrome, Opera, Safari
		return new XMLHttpRequest();
	}
	if (window.ActiveXObject)
	{
		// code for IE6, IE5
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	return null;
}

function UnloadDo(){
	clearInterval(refreshuserlistintervalid);
}

